home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / rebuildSurfaceSetOptionVars. < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.9 KB  |  115 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Mar. 14, 1997
  22. //  Author:         laf
  23. //
  24. //  Description:
  25. //      Global function to make sure the options for rebuild surface are set.
  26. //
  27. //  Input Arguments:
  28. //      Force the factory setting or not.
  29. //
  30. //  Return Value:
  31. //      None.
  32. //
  33.  
  34. global proc rebuildSurfaceSetOptionVars( int $forceFactorySettings )
  35. {
  36.     // Keep Original option var.  This corresponds to the 
  37.     // "-rpo/-replaceOriginal" flag for rebuild surface commands.
  38.     if ($forceFactorySettings || 
  39.         !`optionVar -exists rebuildSurfaceKeepOriginal`) {
  40.         optionVar -intValue rebuildSurfaceKeepOriginal 0;
  41.     }
  42.  
  43.     // Rebuild Type , one of Uniform, Reduce Spans, Match Knots, 
  44.     // No Mult. Knots, Curvature.
  45.     if ($forceFactorySettings || !`optionVar -exists rebuildSurfaceType`) {
  46.         optionVar -intValue rebuildSurfaceType 0;
  47.     }
  48.  
  49.     // Uniform Rebuild Type: Number of resulting spans and degree when
  50.     // rebuilding a surface.
  51.     if ($forceFactorySettings || 
  52.         !`optionVar -exists rebuildSurfaceTypeUniformNumSpansU`) {
  53.         optionVar -intValue rebuildSurfaceTypeUniformNumSpansU 4;
  54.     }
  55.     if ($forceFactorySettings || 
  56.         !`optionVar -exists rebuildSurfaceTypeUniformDegreeU`) {
  57.         optionVar -intValue rebuildSurfaceTypeUniformDegreeU 3;
  58.     }
  59.     if ($forceFactorySettings || 
  60.         !`optionVar -exists rebuildSurfaceTypeUniformNumSpansV`) {
  61.         optionVar -intValue rebuildSurfaceTypeUniformNumSpansV 4;
  62.     }
  63.     if ($forceFactorySettings || 
  64.         !`optionVar -exists rebuildSurfaceTypeUniformDegreeV`) {
  65.         optionVar -intValue rebuildSurfaceTypeUniformDegreeV 3;
  66.     }
  67.  
  68.     // Direction - int, can be 0|1|2
  69.     if ($forceFactorySettings || 
  70.         !`optionVar -exists rebuildSurfaceDirection`) {
  71.         optionVar -intValue rebuildSurfaceDirection 2;
  72.     }
  73.  
  74.     // End knots - nonmultiple
  75.     if ($forceFactorySettings || 
  76.         !`optionVar -exists rebuildSurfaceEndKnots`) {
  77.         optionVar -intValue rebuildSurfaceEndKnots 1;
  78.     }
  79.  
  80.     // Keep Corners - boolean 
  81.     if ($forceFactorySettings || 
  82.         !`optionVar -exists rebuildSurfaceKeepCorners`) {
  83.         optionVar -intValue rebuildSurfaceKeepCorners 1;
  84.     }
  85.  
  86.     // Keep Control Points - boolean 
  87.     if ($forceFactorySettings || 
  88.         !`optionVar -exists rebuildSurfaceKeepControlPoints`) {
  89.         optionVar -intValue rebuildSurfaceKeepControlPoints 0;
  90.     }
  91.  
  92.     // Keep Num Spans - boolean 
  93.     if ($forceFactorySettings || 
  94.         !`optionVar -exists rebuildSurfaceKeepNumSpans`) {
  95.         optionVar -intValue rebuildSurfaceKeepNumSpans 0;
  96.     }
  97.  
  98.     // Tolerance for rebuilding surfaces - whether to use global or local
  99.     // tolerance (boolean), local tolerance (float)
  100.     if ($forceFactorySettings || 
  101.         !`optionVar -exists rebuildSurfaceUseGlobalTolerance`) {
  102.         optionVar -intValue rebuildSurfaceUseGlobalTolerance 1;
  103.     }
  104.     if ($forceFactorySettings || 
  105.         !`optionVar -exists rebuildSurfaceLocalTolerance`) {
  106.         optionVar -floatValue rebuildSurfaceLocalTolerance 0.05;
  107.     }
  108.  
  109.     // Produce polygons or not(boolean)
  110.     if ($forceFactorySettings || 
  111.         !`optionVar -exists rebuildSurfacePolys`) {
  112.         optionVar -intValue rebuildSurfacePolys 0;
  113.     }
  114. }
  115.